//
//  NSDate+PK.swift
//  Panku
//
//  Created by mac on 2017/3/27.
//  Copyright © 2017年 Monster. All rights reserved.
//

extension NSDate {
    
    //获取当前时间
    class func now() -> String {
        let date = NSDate()
        let timeFormatter = DateFormatter()
        timeFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" //(格式可俺按自己需求修整)
        let strNowTime = timeFormatter.string(from: date as Date) as String
        return strNowTime
    }
    
    //获取当前时间 url上传用
    class func urlStringNow() -> String {
        let date = NSDate()
        let timeFormatter = DateFormatter()
        timeFormatter.dateFormat = "yyyyMMddHHmmss" //(格式可俺按自己需求修整)
        let strNowTime = timeFormatter.string(from: date as Date) as String
        return strNowTime
    }
}
